package com.tencent.stat;

import android.content.Context;
import com.tencent.stat.common.StatLogger;
import com.tencent.stat.event.b;
import com.tencent.stat.event.c;
import java.util.Map;

final class y
  implements Runnable
{
  public final void run()
  {
    while (true)
    {
      Long localLong;
      try
      {
        if (StatServiceImpl.a(this.a))
        {
          StatServiceImpl.f().error("The event_id of StatService.trackCustomEndEvent() can not be null or empty.");
          return;
        }
        localLong = (Long)StatServiceImpl.k().remove(this.b);
        if (localLong == null)
          break label169;
        b localb = new b(this.c, StatServiceImpl.a(this.c, false, this.d), this.b.a, this.d);
        localb.b().b = this.b.b;
        localLong = Long.valueOf((System.currentTimeMillis() - localLong.longValue()) / 1000L);
        if (localLong.longValue() != 0L)
          break label160;
        l = 1L;
        localb.a(Long.valueOf(l).longValue());
        new as(localb).a();
        return;
      }
      catch (Throwable localThrowable)
      {
        StatServiceImpl.f().e(localThrowable);
        StatServiceImpl.a(this.c, localThrowable);
        return;
      }
      label160: long l = localLong.longValue();
    }
    label169: StatServiceImpl.f().error("No start time found for custom event: " + this.b.toString() + ", lost trackCustomBeginEvent()?");
  }
}